import Dict from '../dicts/Dict'

export default function(Vue, options) {
  Vue.mixin({
    data() {
      if (this.$options === undefined || this.$options.dictBatch === undefined || this.$options.dictBatch === null) {
        return {}
      }
      const dicts = new Dict()
      dicts.owner = this
      return {
        dicts
      }
    },
    created() {
      if (!(this.dicts instanceof Dict)) {
        return
      }
      this.dicts.init(this.$options.dictBatch).then(() => {})
    },
  })
}
